import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:untitled9/choosehouse.dart';

class CommitPage extends StatefulWidget {
  const CommitPage({super.key});

  @override
  State<CommitPage> createState() => _CommitPageState();
}

class _CommitPageState extends State<CommitPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: GestureDetector(
            onTap: () {
              Navigator.push(context, MaterialPageRoute(builder: (context) {
                return const ChooseHouse();
              }));
            },
            child: const Center(
                child: Text(
              'back',
              style: TextStyle(color: Colors.white),
            ))),
        automaticallyImplyLeading: false,
        backgroundColor: Color.fromRGBO(195, 161, 162, 1.0),
        title: const Center(
            child: Text(
          'Commit        ',
          style: TextStyle(color: Colors.white),
        )),
      ),
      body: Container(
        margin: EdgeInsets.symmetric(horizontal: 20),
        child: Column(
          children: [
            Expanded(
              flex: 3,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: [
                  Column(
                    children: [
                      Container(
                        alignment: AlignmentDirectional.topStart,
                        child: Text(
                          'select house template :',
                          style: TextStyle(fontSize: 18),
                        ),
                      ),
                      SizedBox(
                        height: 20,
                      ),
                      Container(
                          alignment: AlignmentDirectional.center,
                          child: Text('House Template 2'))
                    ],
                  ),
                  Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Padding(
                        padding: const EdgeInsets.symmetric(vertical: 8),
                        child: Text(
                          'Please enter the name of the house :',
                          style: TextStyle(
                              fontSize: 18, fontWeight: FontWeight.w800),
                        ),
                      ),
                      Container(
                          padding: EdgeInsets.symmetric(horizontal: 20),
                          height: 60,
                          decoration: BoxDecoration(
                              border: Border.all(
                                width: .5,
                              ),
                              borderRadius: BorderRadius.circular(30)),
                          child: Center(
                            child: TextField(
                              cursorColor: Colors.black,
                              inputFormatters: [
                                LengthLimitingTextInputFormatter(8),
                              ],
                              decoration: InputDecoration(
                                  border: InputBorder.none,
                                  hintText: 'input house name',
                                  hintStyle: TextStyle(color: Colors.black)),
                            ),
                          ))
                    ],
                  ),
                  Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Padding(
                        padding: const EdgeInsets.symmetric(vertical: 8),
                        child: Text(
                          'Please enter main_card_id :',
                          style: TextStyle(
                              fontSize: 18, fontWeight: FontWeight.w800),
                        ),
                      ),
                      Container(
                          padding: EdgeInsets.symmetric(horizontal: 20),
                          height: 60,
                          decoration: BoxDecoration(
                              border: Border.all(
                                width: .5,
                              ),
                              borderRadius: BorderRadius.circular(30)),
                          child: Center(
                            child: TextField(
                              cursorColor: Colors.black,
                              inputFormatters: [
                                LengthLimitingTextInputFormatter(8),
                              ],
                              decoration: const InputDecoration(
                                  border: InputBorder.none,
                                  hintText: 'input main_card_id',
                                  hintStyle: TextStyle(color: Colors.black)),
                            ),
                          ))
                    ],
                  ),
                  Container(
                    height: 50,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(25),
                        border: Border.all(width: .5)),
                    child: Center(
                      child: Text(
                        'Commit',
                        style: TextStyle(
                            fontSize: 20, fontWeight: FontWeight.w600),
                      ),
                    ),
                  ),
                ],
              ),
            ),
            Expanded(flex: 2, child: Container())
          ],
        ),
      ),
    );
  }
}
